package com.itheima.chapter09.io;

import com.itheima.chapter09.io.charstream.OutputStreamWriterDemo;

import java.io.*;

//转换流的读写
public class ConversionStreamDemo {
    public static void main(String[] args) throws IOException {
        OutputStreamWriter osw =new OutputStreamWriter(new FileOutputStream("MyIdeaTest\\f.txt"));
        osw.write("啦啦啦，我爱你中国");
        osw.close();
        InputStreamReader isr = new InputStreamReader(new FileInputStream("MyIdeaTest\\c.txt"),"gbk");
        int ch ;
        while ((ch = isr.read())!=-1){
            System.out.println((char)ch);
        }
        isr.close();

    }
}
